package cn.edu.zafu.bigdata.Yum;

import java.util.Objects;

public class Cube {
    private double length,width,height;

    public Cube(double length, double width, double height) {
        this.length = length;
        this.width = width;
        this.height = height;
    }

    public double getLength() {
        return length;
    }

    public double getWidth() {
        return width;
    }

    public double getHeight() {
        return height;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Cube cube)) return false;
        return Double.compare(cube.getLength(), getLength()) == 0 && Double.compare(cube.getWidth(), getWidth()) == 0 && Double.compare(cube.getHeight(), getHeight()) == 0;
    }

    @Override
    public int hashCode() {
        return Objects.hash(getLength(), getWidth(), getHeight());
    }
}
